import request from '@/utils/request'

/**新增、编辑、删除、根据Id查询**/
export const commonInterface = (url, data, method) => {
	if (method === 'post' || method === 'put') {
		return request({
			url: url,
			method: method,
			data: data
		});
	} else {
		url += data;
		return request({
			url: url,
			method: method
		})
	}
}


/**通用下载**/
export const commonDownload = (url) => {
	return request({
		url: url,
		method: 'post',
		responseType: 'blob'
	})
}

export const commonTemplate = (name, result) => {
	let a = document.createElement('a')
	a.download = `${name}_${new Date().getTime()}.xlsx`
	a.href = URL.createObjectURL(result)
	document.body.appendChild(a)
	a.click()
	document.body.removeChild(a)
}

/**通用上传**/
export const commonUpload = (data) => {
	return request({
		url: '/back/common/upload',
		method: 'post',
		data: data
	})
}

/**行政区**/
export const commonGetDistrictList = () => {
	return request({
		url: '/back/system/dict/data/type/rf_qu_code',
		method: 'get',
	})
}

/**车载警报器类型**/
export const commonCarAlarmType = () => {
	return request({
		url: '/back/system/dict/data/type/chezai_type',
		method: 'get',
	})
}

/**车载警报器控制方式**/
export const commonCarControlType = () => {
	return request({
		url: '/back/system/dict/data/type/jb_control_type',
		method: 'get',
	})
}

/**人防工程平战转换顺序内容类型**/
export const commonZhsxType = () => {
	return request({
		url: '/back/system/dict/data/type/zhsx_type',
		method: 'get',
	})
}

/**人防工程--工程隶属**/
export const commonGclsList = () => {
	return request({
		url: '/back/system/dict/data/type/rf_gc_ls',
		method: 'get',
	})
}
/**人防工程--构筑分类**/
export const commonGzflList = () => {
	return request({
		url: '/back/system/dict/data/type/rf_gz_fenlei',
		method: 'get',
	})
}
/**应急避难所--类型**/
export const commonYjTypeList = () => {
	return request({
		url: '/back/system/dict/data/type/rf_yj_type',
		method: 'get',
	})
}

/**重要经济目标--指挥部**/
export const commonZhbList = () => {
	return request({
		url: '/back/renfang/zhtx/command/head_list',
		method: 'get',
	})
}
/**重要经济目标--类型**/
export const commonJjmbType = () => {
	return request({
		url: '/back/system/dict/data/type/rf_base_unit_type',
		method: 'get',
	})
}

/**重要经济目标--等级**/
export const commonJjmbLevel = () => {
	return request({
		url: '/back/system/dict/data/type/rf_zyjj_level',
		method: 'get',
	})
}

/** 交通运输--可征用车辆--车辆类型 **/
export const commonKzyCarType = () => {
	return request({
		url: '/back/system/dict/data/type/rf_requisition_type',
		method: 'get',
	})
}
/** 交通运输--可征用车辆--平战状态 **/
export const commonKzyCarZt = () => {
	return request({
		url: '/back/system/dict/data/type/rf_bzh_type',
		method: 'get',
	})
}

/** 跨区域支援--行动协同--阶段 **/
export const commonStageList = () => {
	return request({
		url: '/back/system/dict/data/type/rf_kqy_xdxt_stage',
		method: 'get',
	})
}

/** 政治工作计划 -- 工作要点 -- 阶段类型 **/
export const commonJdType = () => {
	return request({
		url: '/back/system/dict/data/type/rf_bz_zzgz_content_type',
		method: 'get',
	})
}

/** 政治工作计划 -- 党员信息 -- 党员类型 **/
export const commonDyType = () => {
	return request({
		url: '/back/system/dict/data/type/rf_bz_zzgz_party_type',
		method: 'get',
	})
}
/** 政治工作计划 -- 党员信息 -- 党员组织类型 **/
export const commonDyZzType = () => {
	return request({
		url: '/back/system/dict/data/type/rf_bz_zzgz_party_org',
		method: 'get',
	})
}

/** 物资保障 -- 物资需求统计 -- 类型 **/
export const commonWzType = () => {
	return request({
		url: '/back/system/dict/data/type/rf_shwz_type',
		method: 'get',
	})
}

/** 物资保障 -- 防化物资 -- 物品名称 **/
export const commonWzmc = () => {
	return request({
		url: '/back/system/dict/data/type/rf_fhwz_name',
		method: 'get',
	})
}

/** 外(台)军 -- 打击规模 -- 军事基地名称 **/
export const commonJsjd = () => {
	return request({
		url: '/back/renfang/jjmb/djfs/getMilitary',
		method: 'get',
	})
}

/** 常用配置 -- 常用类型配置 -- 一级分类 **/
export const commonConfig = () => {
	return request({
		url: '/back/system/dict/data/type/rf_text_desc',
		method: 'get',
	})
}

/** 人防指挥 -- 空情预警 -- 观察哨 --- 观察哨类型 **/
export const commonObservatonPostType = () => {
	return request({
		url: '/back/system/dict/data/type/rf_post_type',
		method: 'get',
	})
}

// 用户
export const commonSystemUser = () => {
	return request({
		url: '/back/system/user/',
		method: 'get',
	})
}

//警报报知 --类型
export const commonJbType = () => {
	return request({
		url: '/back/system/dict/data/type/rf_fixed_type',
		method: 'get',
	})
}

//医疗保障--医院类型
export const commonMedicalType = () => {
	return request({
		url: '/back/system/dict/data/type/yl_jglb',
		method: 'get',
	})
}
//医疗保障--医院分级
export const commonMedicalFj = () => {
	return request({
		url: '/back/system/dict/data/type/yl_yydj',
		method: 'get',
	})
}

//交通运输--火车站--类型
export const commonHczType = () => {
	return request({
		url: '/back/system/dict/data/type/bz_hczlx',
		method: 'get',
	})
}

//人防指挥所--指挥平台--指挥所类型
export const commonZhsType = () => {
	return request({
		url: '/back/system/dict/data/type/rf_command_post_type',
		method: 'get',
	})
}
//人防指挥所--指挥平台--所属指挥部
export const commonShzhb = () => {
	return request({
		url: '/back/system/dict/data/type/rfzhb',
		method: 'get',
	})
}
//人防指挥所--指挥平台--防常规式武器等级
export const commonFcgswqdj = () => {
	return request({
		url: '/back/system/dict/data/type/rf_common_level',
		method: 'get',
	})
}
//人防指挥所--指挥平台--防核武器武器等级
export const commonFhwqdj = () => {
	return request({
		url: '/back/system/dict/data/type/rf_nuclear_level',
		method: 'get',
	})
}
//人防指挥所--指挥平台--防化级别
export const commonFhjb = () => {
	return request({
		url: '/back/system/dict/data/type/rf_fh_level',
		method: 'get',
	})
}
//人防指挥所--指挥平台--工程完成情况
export const commonGcwcqk = () => {
	return request({
		url: '/back/system/dict/data/type/rf_engineering_completion',
		method: 'get',
	})
}
//人防指挥所--指挥平台--工程健全情况
export const commonGcJqqk = () => {
	return request({
		url: '/back/system/dict/data/type/rf_sound_situation',
		method: 'get',
	})
}

//人防指挥所--指挥平台--固定指挥所--网系
export const commonWx = () => {
	return request({
		url: '/back/system/dict/data/type/rf_net_series',
		method: 'get',
	})
}
//人防指挥所--指挥平台--固定指挥所--来源
export const commonLy = () => {
	return request({
		url: '/back/system/dict/data/type/rf_net_from',
		method: 'get',
	})
}

//人防指挥--指挥平台--指挥所
export const commonZhs = () => {
	return request({
		url: '/back/renfang/zhtx/posta/head_list',
		method: 'get',
	})
}

//人防指挥--固定指挥所要素房间--类型
export const commonRoomType = () => {
	return request({
		url: '/back/system/dict/data/type/rf_elements_type',
		method: 'get',
	})
}

//人防指挥--机动指挥所车辆
export const commonZhsCarType = () => {
	return request({
		url: '/back/system/dict/data/type/rf_car_type',
		method: 'get',
	})
}
//人防指挥--机动指挥所车辆--指挥机构
export const commonZhsjg = () => {
	return request({
		url: '/back/renfang/zhtx/cara/flexible_list',
		method: 'get',
	})
}

//人防指挥--便携式指挥平台--运载方式
export const commonCarryWay = () => {
	return request({
		url: '/back/system/dict/data/type/rf_carry_way',
		method: 'get',
	})
}

//人防指挥部--指挥平台--指控装备列表类型
export const commonZkzbType = () => {
	return request({
		url: '/back/system/dict/data/type/rf_zhzb_type',
		method: 'get',
	})
}

//人防指挥部--指挥平台--设备生命周期状态
export const commonZkzbLife = () => {
	return request({
		url: '/back/system/dict/data/type/rf_sbzqzt',
		method: 'get',
	})
}

//人防指挥部--指挥平台--通信网络 安全等级
export const commonSafetyLevel = () => {
	return request({
		url: '/back/system/dict/data/type/rf_security_level',
		method: 'get',
	})
}

//人防指挥部--能力需求--情报信息保障通信--网络通信类型
export const commonTxwlType = () => {
	return request({
		url: '/back/system/dict/data/type/rf_txwl_type',
		method: 'get',
	})
}

//专业队 大类型
export const commonZydTypeA = () => {
	return request({
		url: '/back/system/dict/data/type/rf_zyd_typeA',
		method: 'get',
	})
}
//专业队 小类型
export const commonZydTypeB = () => {
	return request({
		url: '/back/system/dict/data/type/rf_zyd_typeB',
		method: 'get',
	})
}

//疏散隐蔽--人防工程--工程编码
export const commonGcbm = () => {
	return request({
		url: '/back/system/dict/data/type/rf_sound_situation',
		method: 'get',
	})
}